1. Technical Field
The technical field relates to an image decoding apparatus and method which can decode an image compression stream at a high speed.
2. Background Art
As a conventional method of decoding an image stream compressed according to MPEG2, H.264/AVC, or the like at a high speed, a method of dividing a decoding process into slices and allocating each slice to each of a plurality of processors to perform parallel processing in decoding with the plurality of processors, is generally known. However, this method cannot be applied unless one frame is divided into a plurality of slices. When one frame is not divided into a plurality of slices, a method is employed, in which a decoding process is divided in units of frames so that processors perform the divided processes in parallel.
On the other hand, there may be dependence between the compressed frames. For example, in the MPEG-2 standard, I frame can be singularly decoded without depending on other frames. However, P frame is decoded with reference to I frame, and B frame is decoded with reference to I frame and P frame. That is, compressed frames can be grouped according to dependence on other frames in a decoding process.
The frames can be classified into three groups including, for example, group A, group B, and group C. Group A includes a frame which does not refer to other frame, such as I frame. Group B includes a frame which refers to another frame and can be referred to by another frame, such as P frame. Group C includes a frame which refers to another frame but is not referred to by another frame, such as B frame.
That is, the frame belonging to group A does not depend on a decoding result of a frame belonging to any groups. However, the frame belonging to group B depends on a decoding result of a frame belonging to group A and cannot be decoded unless a frame to be referred is decoded. The frame belonging to group C depends on a decoding result of a frame belonging to group A or group B and cannot be decoded unless a frame to be referred is decoded.
Therefore, the frames belonging to group A do not depend on each other, and thus decoding processes for the frames can be performed in parallel. However, a decoding process for a frame belonging to group B and a decoding process for a frame depending on the frame belonging to group C cannot be performed in parallel. For this reason, while one processor performs the process which cannot be done in parallel, the other processor is in an idle state which is a state for waiting process.
In order to decode frames which depend on each other, there is proposed an image decoding method (see JP-A-2000-295616) which determines shares of parallel processes performed by processors according to a dependence of frames. In addition, there is also proposed an image decoding method (see JP-A-2005-175997) which divides one frame into a plurality of slices and process the slices in parallel when decoding a frame which is subjected to bidirectional predictive encoding, and which performs parallel processing in units of frames when decoding a frame which is subjected to the other encoding schemes. By using these methods, idle times of the processors are reduced.
Even though the above stated conventional image decoding process is used, a processor may be in an idle state for a long time. Such an example will be described below with reference to FIG. 12.
In an example in FIG. 12, it is assumed that a decoding process is performed by using four processors in parallel. As frames to be decoded, a total of 6 frames including frames 0 to 5 are used with one frame composed of one slice. Frame 0 belongs to group A to which a frame which does not depend on decoding results of other frames belongs. Frame 3 belongs to group B to which a frame which refers to another frame and is referred to by the other frame, and refers to frame 0. Frames 1, 2, 4, and 5 belong to group C to which a frame which refers to another frame but is not referred to by the other frame, and refer to frames 0 and 3. It is assumed that times required for decoding processes for the respective frames are equal.
Since frames 1 to 5 refer to frame 0, a decoding process for these frames cannot be started until a decoding process for frame 0 is completed. As a result, while frame 0 is being decoded, three of four processors are set in an idle state. After the decoding process for frame 0 is finished, frame 3 can be decoded. Since frames 1, 2, 4, and 5 refer to frame 3, decoding processes for those frames cannot be started until the decoding process for frame 3 is completed. For this reason, while frame 3 is being decoded, three of the four processors are set in an idle state. After the decoding process for frame 3 is completed, parallel processing for frames 1, 2, 4, and 5 can be performed. In this manner, 50% of a time required for all the processes corresponds to an idle time. Specifically, only 50% of the capabilities of the processors can be disadvantageously utilized.